package com.jnxx.basic.exception;

import com.jnxx.basic.enumException.GlobalExceptionEnum;
import lombok.Data;

@Data
public class GlobalException extends RuntimeException{

    private String code;
    private String globalMessage;

    public GlobalException() {
        super();
    }

    public GlobalException(String globalMessage, String code) {
        super(globalMessage);
        this.code = code;
        this.globalMessage = globalMessage;
    }

    public GlobalException(GlobalExceptionEnum globalExceptionEnum) {
        super(globalExceptionEnum.getMassage());
        this.code = globalExceptionEnum.getCode();
        this.globalMessage = globalExceptionEnum.getMassage();
    }


}
